/**
 * Created by mFramework.
 * User: Mauro
 * Date: 27/05/11
 * Time: 11:02
 */
MF.views.Actioncard = Ext.extend(Ext.Panel, {
    title: 'Action',
    iconCls: 'action',
    dockedItems: [
        {
            xtype: "toolbar",
            title: "Buttons",
            defaults: {
                xtype: 'button'
            },
            items: [
                {
                    iconCls: 'delete',
                    iconMask: true,
                    ui: 'plain',
                    handler: function() {
                        MF.views.homecard.tab.setBadge("");
                    }
                },
                { xtype: 'spacer'},
                {
                    iconCls: 'star',
                    iconMask: true,
                    ui: 'plain',
                    handler: function() {
                        var hometab = MF.views.homecard.tab,
                            badgenumber = parseInt(hometab.badgeText),
                            nextnumber = isNaN(badgenumber) ? 1 : badgenumber + 1;
                        hometab.setBadge(nextnumber);
                    }
                }
            ]
        }
    ]
});

Ext.reg('actioncard', MF.views.Actioncard);